<template name="reg">
<br><br><br><br>
<link rel="stylesheet" href="assets/css/Registration-Form-with-Photo.css">
<script type="text/javascript">
  var c =91;
  function timecounter(){
    $("#sms").attr('disabled', true);
  if (c==0) {
    document.getElementById('sms').value = '获取手机验证码';
    $("#sms").attr('disabled', false);
    return false;

  }
  setTimeout("timecounter()",1000);

  c--;
  document.getElementById('sms').value=c+'秒之后重新获取';


  return c;
}
  function sendsms(text, mobile_number){
    //
    // 此处接入短信平台
    var phonereg = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
    var mobile_number = $("#valid_mobile").val();




    if (!phonereg.test(mobile_number)) {
      alert('请输入正确的手机号！');
      return ;
    }
    c = 91;

    timecounter();

    $.ajax({
      type: "POST",
      url: "http://yunchixing.com:8080/sms.php",
      dataType: "json",
      data: {
        sms_param: "{\"valid\":\""+text+"\",\"name\":\"用户\"}",
        rec_num: mobile_number.toString()

      },
      success: function(data) {
        console.log(data);


      }
    });



  }
</script>
	<div class="register-photo">
        <div class="form-container">
            <div class="image-holder"></div>
            <form method="post">
                <h2 class="text-center"><strong>注册</strong>成为我们的会员</h2>
                {{> flashMessages}}
                <div class="form-group">
                    <input class="form-control" type="username" name="username" placeholder="用户名">
                </div>
                <div class="form-group">
                    <input id="valid_mobile" class="form-control" type="mobile" name="mobile" placeholder="手机号">
                    <input id="sms" class="btn btn-primary btn-block" type="button" value="获取手机验证码" />
                </div>
                <div class="form-group">
                    <input id="valid_text" class="form-control" type="username" name="username" placeholder="手机验证码">
                </div>
                <div class="form-group">
                    <input  class="form-control" type="password" name="password" placeholder="设置密码">
                </div>
                <div class="form-group">
                    <input class="form-control" type="password" name="password-repeat" placeholder="重复密码以确认">
                </div>
                <div class="form-group">
                    <div class="checkbox">
                        <label class="control-label">
                            <input type="checkbox" checked="">我同意
                            <a href="">注册条款</a>
                            </label>
                    </div>
                </div>
                <div class="form-group">
                    <button class="btn btn-primary btn-block" type="submit">注册</button>
                </div><a href="/login" class="btn btn-info">已经是我们会员? 此处登录</a></form>
        </div>
    </div>
</template>
